# Contributor: Tiago Ilieve <tiago.myhro@gmail.com>
# Maintainer: Tiago Ilieve <tiago.myhro@gmail.com>
pkgname=gron
pkgver=0.6.0
pkgrel=2
pkgdesc="Make JSON greppable"
url="https://github.com/tomnomnom/gron"
arch="all"
license="MIT"
depends=""
makedepends="go>=1.11"
source="gron-$pkgver.tar.gz::https://github.com/tomnomnom/gron/archive/v${pkgver}.tar.gz
	go.mod go.sum"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"

	go build -v -ldflags "-s -w -X main.gronVersion=$pkgver" -o gron
}

check() {
	cd "$builddir"

	./gron --version
	./gron testdata/one.json
	go test
}

package() {
	cd "$builddir"

	install -Dm755 ./gron "$pkgdir"/usr/bin/gron
}

sha512sums="aa1e2e6d00927b8b0abb5b39593deed9037d7f1fdf669f1c3c2e28ce117b270e10758027afd962499783a1f6f4d848cc6c6a0f6e4323ba8c53be14e1add622fe  gron-0.6.0.tar.gz
30d5e835903698ae1cb1203c986b4eb4989aa74fcc50b907656b5182fd5060e403ba991dcba3a65a3a215898dfeb5caa46f24ec0bc58535e4f80d937583407bb  go.mod
8d1898bd5d6dba0e121615b4c6c279b0df031eb2ec900c2afc39126be6006557f1b5e87c1a0572cca2ef45ec66775b7606b5701f28c6dbefaa9fa2fd65587a4d  go.sum"
